﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    [Serializable]
    [DataContract] 
    public class BianZhiJieYongEmpModel
    {
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        private int _EmpBasicID;
        [DataMember]
        public int EmpBasicID
        {
            get { return _EmpBasicID; }
            set { _EmpBasicID = value; }
        }

        private int _BianZhiJieYongID;
        [DataMember]
        public int BianZhiJieYongID
        {
            get { return _BianZhiJieYongID; }
            set { _BianZhiJieYongID = value; }
        }

        public static BianZhiJieYongEmpModel FillEntity(DataRow dr)
        {
            BianZhiJieYongEmpModel right = new BianZhiJieYongEmpModel();
            if (dr.Table != null && dr.Table.Columns.Contains("ID") && !string.IsNullOrEmpty(dr["ID"].ToString())) right.ID =Convert.ToInt32(dr["ID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("EmpBasicID") && !string.IsNullOrEmpty(dr["EmpBasicID"].ToString())) right.EmpBasicID = Convert.ToInt32(dr["EmpBasicID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("BianZhiJieYongID") && !string.IsNullOrEmpty(dr["BianZhiJieYongID"].ToString())) right.BianZhiJieYongID = Convert.ToInt32(dr["BianZhiJieYongID"]);
            return right;

        }
    }
}
